home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 4 / QRZ Ham Radio Callsign Database - Volume 4.iso / files / packet / ohmqkdlc / diffs.txt < prev    next >
Text File  |  1994-11-27  |  12KB  |  444 lines

  1. Diffs against  KA9Q  S930104  -source set for creating OH1MQK [mea@utu.fi]
  2. features -- and his DDLC card driver, and new encoding type ("HDLC")...
  3.  
  4. Files   ddlc.c, ddlc.h, ddlcvec.s, ddlc.txt, ddlc.doc, ddlctest.c, rawhdlc.c
  5. and rawhdlc.h  are provided separately.  (ddlcpack.lzh)
  6.  
  7. Phil had made (in display.c) the query of actual screen size, and thus there
  8. is no longer need for OH1MQK mod for it -- in stdio.c...
  9. (Try with DOS 4/5:  MODE CON LINES=50, and then start NET)
  10.  
  11. Rundown:
  12.     config.h:    Added DDLC-, and RAWHDLC-options, turned this & that on..
  13.     config.c:    Added DDLC and RAWHDLC -drivers, and couple of *_helper()-
  14.         routines. ( attach_helper(), start_helper(), stop_helper() )
  15.     commands.h:    Added DDLC and RAWHDLC related commans.
  16.     cmdparse.c:    Added new feature into  cmdparse() -routine: it can call up
  17.         *_helper() -routines if needed.
  18.     netuser.c:    Corrected IP-number parsing to conform usual Internet style:
  19.           127.1 == 127.0.0.1, NOT 127.1.0.0 !
  20.  
  21.  
  22.  
  23.  
  24.  
  25. *** config.h    1992/12/28 09:05:29    1.22
  26. --- config.h    1993/01/06 03:31:32
  27. ***************
  28. *** 9,19 ****
  29.   #define    RIP        1    /* Include RIP routing */
  30.   #define    HOPCHECK    1    /* IP path tracing command */
  31.   #define    DIALER        1    /* SLIP redial code */
  32. ! #undef    NRS        1    /* NET/ROM async interface */
  33. ! #undef    NETROM        1    /* NET/ROM network support */
  34.   #undef    LZW        1    /* LZW-compressed sockets */
  35.   #define    SLIP        1    /* Serial line IP on built-in ports */
  36. ! #undef PPP        1    /* Point-to-Point Protocol code */
  37.   #define VJCOMPRESS    1    /* Van Jacobson TCP compression for SLIP */
  38.   #define    TRACEBACK    1    /* Stack traceback code */
  39.   #undef    LOCSOCK        1    /* Local loopback sockets */
  40. --- 9,19 ----
  41.   #define    RIP        1    /* Include RIP routing */
  42.   #define    HOPCHECK    1    /* IP path tracing command */
  43.   #define    DIALER        1    /* SLIP redial code */
  44. ! #define    NRS        1    /* NET/ROM async interface */
  45. ! #define    NETROM        1    /* NET/ROM network support */
  46.   #undef    LZW        1    /* LZW-compressed sockets */
  47.   #define    SLIP        1    /* Serial line IP on built-in ports */
  48. ! #define PPP        1    /* Point-to-Point Protocol code */
  49.   #define VJCOMPRESS    1    /* Van Jacobson TCP compression for SLIP */
  50.   #define    TRACEBACK    1    /* Stack traceback code */
  51.   #undef    LOCSOCK        1    /* Local loopback sockets */
  52. ***************
  53. *** 31,46 ****
  54.   #undef    HS        1    /* High speed (56kbps) modem driver */
  55.   #undef    HAPN        1    /* Hamilton Area Packet Network driver code */
  56.   #undef    EAGLE        1    /* Eagle card driver */
  57. ! #undef    PI        1    /*  PI card driver */
  58.   #define    PACKET        1    /* FTP Software's Packet Driver interface */
  59.   #undef    PC100        1    /* PAC-COM PC-100 driver code */
  60.   #undef    APPLETALK    1    /* Appletalk interface (Macintosh) */
  61. ! #undef    DRSI        1    /* DRSI PCPA slow-speed driver */
  62.   #undef    SCC        1    /* PE1CHL generic scc driver */
  63.   #define    ASY        1    /* Asynch driver code */
  64. ! #undef    SLFP        1    /* SLFP packet driver class supported */
  65. ! #define    CDMA_DM        1    /* CDMA mobile DM interface */
  66.   #undef    QTSO        1    /* CDMA QTSO data interface */
  67.   
  68.   #if defined(NRS)
  69.   #undef    NETROM
  70. --- 31,48 ----
  71.   #undef    HS        1    /* High speed (56kbps) modem driver */
  72.   #undef    HAPN        1    /* Hamilton Area Packet Network driver code */
  73.   #undef    EAGLE        1    /* Eagle card driver */
  74. ! #define    PI        1    /*  PI card driver */
  75.   #define    PACKET        1    /* FTP Software's Packet Driver interface */
  76.   #undef    PC100        1    /* PAC-COM PC-100 driver code */
  77.   #undef    APPLETALK    1    /* Appletalk interface (Macintosh) */
  78. ! #define    DRSI        1    /* DRSI PCPA slow-speed driver */
  79.   #undef    SCC        1    /* PE1CHL generic scc driver */
  80.   #define    ASY        1    /* Asynch driver code */
  81. ! #undef     SLFP        1    /* SLFP packet driver class supported */
  82. ! #undef    CDMA_DM        1    /* CDMA mobile DM interface */
  83.   #undef    QTSO        1    /* CDMA QTSO data interface */
  84. + #define DDLC        1    /* OH1MQK's DDLC-card driver [mea@utu.fi] */
  85. + #define AX25        1    /* the DDLC card can do without as well.. */
  86.   
  87.   #if defined(NRS)
  88.   #undef    NETROM
  89. ***************
  90. *** 58,63 ****
  91. --- 60,69 ----
  92.   
  93.   #if (defined(PC_EC) || defined(PACKET))
  94.   #define    ETHER    1        /* Generic Ethernet code */
  95. + #endif
  96. + #if (defined(DDLC))
  97. + #define RAWHDLC 1        /* Raw HDLC framing on the link */
  98.   #endif
  99.   
  100.   #if defined(CMDA_DM)
  101. *** config.c    1992/12/30 10:56:44    1.42
  102. --- config.c    1993/01/06 04:45:14
  103. ***************
  104. *** 48,53 ****
  105. --- 48,56 ----
  106.   #ifdef    QTSO
  107.   #include "qtso.h"
  108.   #endif
  109. + #ifdef    RAWHDLC        /* OH1MQK [mea@utu.fi] */
  110. + #include "rawhdlc.h"
  111. + #endif
  112.   #ifdef    CDMA_DM
  113.   #include "dm.h"
  114.   #endif
  115. ***************
  116. *** 57,62 ****
  117. --- 60,71 ----
  118.   static int dostart __ARGS((int argc,char *argv[],void *p));
  119.   static int dostop __ARGS((int argc,char *argv[],void *p));
  120.   
  121. + static void attach_helper __ARGS((int argc, char *line));
  122. + #ifdef SERVERS
  123. + static void start_helper  __ARGS((int argc, char *line));
  124. + static void stop_helper   __ARGS((int argc, char *line));
  125. + #endif
  126.   #ifdef    AX25
  127.   static void axip __ARGS((struct iface *iface,struct ax25_cb *axp,char *src,
  128.       char *dest,struct mbuf *bp,int mcast));
  129. ***************
  130. *** 98,105 ****
  131. --- 107,119 ----
  132.   #ifdef    ASY
  133.       "asystat",    doasystat,    0, 0, NULLCHAR,
  134.   #endif
  135. + #if 1 /* [mea@utu.fi] I try my magic helper functions.. */
  136. +     "attach",    doattach,    0, -2,
  137. +         (void*)attach_helper,
  138. + #else
  139.       "attach",    doattach,    0, 2,
  140.           "attach <hardware> <hw specific options>",
  141. + #endif
  142.   #ifdef    AX25
  143.       "ax25",        doax25,        0, 0, NULLCHAR,
  144.   #endif
  145. ***************
  146. *** 118,123 ****
  147. --- 132,140 ----
  148.       "close",    doclose,    0, 0, NULLCHAR,
  149.   /* This one is out of alpabetical order to allow abbreviation to "d" */
  150.       "disconnect",    doclose,    0, 0, NULLCHAR,
  151. + #ifdef    DDLC
  152. +     "ddlc",        do_ddlc,    0, 2, "ddlc <cmd>",
  153. + #endif
  154.       "delete",    dodelete,    0, 2, "delete <file>",
  155.       "detach",    dodetach,    0, 2, "detach <interface>",
  156.   #ifdef    DIALER
  157. ***************
  158. *** 220,228 ****
  159. --- 237,250 ----
  160.       "smtp",        dosmtp,        0, 0, NULLCHAR,
  161.       "socket",    dosock,        0, 0, NULLCHAR,
  162.   #ifdef    SERVERS
  163. + #if 1 /* [mea@utu.fi] Try start_helper(), stop_helper() */
  164. +     "start",    dostart,    0, -2, (void*)start_helper,
  165. +     "stop",        dostop,        0, -2, (void*)stop_helper,
  166. + #else
  167.       "start",    dostart,    0, 2, "start <servername>",
  168.       "stop",        dostop,        0, 2, "stop <servername>",
  169.   #endif
  170. + #endif
  171.       "tcp",        dotcp,        0, 0, NULLCHAR,
  172.       "telnet",    dotelnet,    1024, 2, "telnet <address>",
  173.   #ifdef    notdef
  174. ***************
  175. *** 321,326 ****
  176. --- 343,357 ----
  177.       "   <intack> <vec> [p]<clock> [hdwe] [param]\n"
  178.       "attach scc <chan> slip|kiss|nrs|ax25ui|ax25i <label> <mtu> <speed> <bufsize> [call] ",
  179.   #endif
  180. + #ifdef    DDLC
  181. +     "ddlc", ddlc_attach, 0, 5,
  182. +     "attach ddlc init <memaddr> <vec> [<size>]\n"
  183. +     "\tattach ddlc <chan> "
  184. + #ifdef    AX25
  185. +     "ax25|"
  186. + #endif
  187. +     "hdlc <label> <mtu> <speed> <duplex> [ip-addr]",
  188. + #endif
  189.       NULLCHAR,
  190.   };
  191.   
  192. ***************
  193. *** 659,664 ****
  194. --- 690,702 ----
  195.       NULLFP,        sl_dump,    dd_init,    dd_stat,
  196.   #endif
  197.   
  198. + #ifdef    RAWHDLC /* [mea@utu.fi] */
  199. +     "HDLC",        hdlc_send,    hdlc_output,    NULL,
  200. +     NULL,        CL_NONE,    0,        ip_proc,
  201. +     NULLFP,        ip_dump,    NULLFP,        NULLFP,
  202. +                  /* same DirectDialing, as with CDMA? */
  203. + #endif /* RAWHDLC */
  204.       NULLCHAR,    NULLFP,        NULLFP,        NULL,
  205.       NULL,        -1,        0,        NULLFP,
  206.       NULLFP,        NULLVFP,    NULLFP,        NULLFP,
  207. ***************
  208. *** 712,717 ****
  209. --- 750,758 ----
  210.   #ifdef    SCC
  211.       scctimer,
  212.   #endif
  213. + #ifdef    DDLC /* [mea@utu.fi] */
  214. +     ddlctimer,
  215. + #endif
  216.       NULL,
  217.   };
  218.   
  219. ***************
  220. *** 735,740 ****
  221. --- 776,784 ----
  222.   #ifdef    SCC
  223.       sccstop,
  224.   #endif
  225. + #ifdef    DDLC /* [mea@utu.fi] */
  226. +     ddlcstop,
  227. + #endif
  228.       uchtimer,    /* Unlink timer handler from timer chain */
  229.       NULLVFP,
  230.   };
  231. ***************
  232. *** 905,911 ****
  233. --- 949,1027 ----
  234.   }
  235.   #endif /* !defined(VJCOMPRESS) && defined(ASY) */
  236.   
  237. + static void
  238. + attach_helper(argc,line)
  239. + int argc;
  240. + char *line;
  241. + {
  242. +     struct cmds *cmdp = Attab;
  243. +     int col = 0, siz;
  244. +     printf("attach <device> <arg(s)> -- with possible devices:\n");
  245. +     for (;cmdp->name;++cmdp) {
  246. +         if (col == 0) printf("    ");
  247. +         siz = strlen(cmdp->name);
  248. +         printf("%s ",cmdp->name);
  249. +         col += siz + 1;
  250. +         if (col > 60) {
  251. +             printf("\n");
  252. +             col = 0;
  253. +         }
  254. +     }
  255. +     if (col)
  256. +         printf("\n");
  257. + }
  258.   #ifdef    SERVERS
  259. + static void
  260. + start_helper(argc,line)
  261. + int argc;
  262. + char *line;
  263. + {
  264. +     struct cmds *cmdp = Startcmds;
  265. +     int col = 0, siz;
  266. +     printf("start <service> -- with possible services:\n");
  267. +     for (;cmdp->name;++cmdp) {
  268. +         if (col == 0) printf("    ");
  269. +         siz = strlen(cmdp->name);
  270. +         printf("%s ",cmdp->name);
  271. +         col += siz + 1;
  272. +         if (col > 60) {
  273. +             printf("\n");
  274. +             col = 0;
  275. +         }
  276. +     }
  277. +     if (col)
  278. +         printf("\n");
  279. + }
  280. + static void
  281. + stop_helper(argc,line)
  282. + int argc;
  283. + char *line;
  284. + {
  285. +     struct cmds *cmdp = Stopcmds;
  286. +     int col = 0, siz;
  287. +     printf("stop <service> -- with possible services:\n");
  288. +     for (;cmdp->name;++cmdp) {
  289. +         if (col == 0) printf("    ");
  290. +         siz = strlen(cmdp->name);
  291. +         printf("%s ",cmdp->name);
  292. +         col += siz + 1;
  293. +         if (col > 60) {
  294. +             printf("\n");
  295. +             col = 0;
  296. +         }
  297. +     }
  298. +     if (col)
  299. +         printf("\n");
  300. + }
  301.   static int
  302.   dostart(argc,argv,p)
  303.   int argc;
  304. *** commands.h    1992/12/28 09:04:56    1.13
  305. --- commands.h    1993/01/06 04:14:10
  306. ***************
  307. *** 28,33 ****
  308. --- 28,39 ----
  309.   /* In bootpd.c */
  310.   int bootpdcmd __ARGS((int argc,char *argv[],void *p));
  311.   
  312. + /* In ddlc.c: [mea@utu.fi] */
  313. + int do_ddlc    __ARGS((int argc,char *argv[],void *p));
  314. + int ddlc_attach __ARGS((int argc,char *argv[],void *p));
  315. + void ddlctimer __ARGS((void));    /* XX: ?? */
  316. + void ddlcstop  __ARGS(());    /* XX: ?? */
  317.   /* In dialer.c: */
  318.   int dodialer __ARGS((int argc,char *argv[],void *p));
  319.   
  320. *** cmdparse.c    1992/05/01 08:20:24    1.4
  321. --- cmdparse.c    1993/01/06 04:03:22
  322. ***************
  323. *** 8,13 ****
  324. --- 8,16 ----
  325.    *        bit16cmd for PPP
  326.    * Mar '91 - Glenn McGregor
  327.    *        handle string escaped sequences
  328. +  * Jul '92 - Matti Aarnio, OH1MQK [mea]
  329. +  *              if argcmin < 0, then argc_errmsg is a pointer to
  330. +  *        a helper routine which uses arguments:  argc, line
  331.    */
  332.   #include <stdio.h>
  333.   #include "global.h"
  334. ***************
  335. *** 188,193 ****
  336. --- 191,202 ----
  337.           printf("Usage: %s\n",cmdp->argc_errmsg);
  338.           return -1;
  339.       }
  340. +     /* [mea] If NEGATIVE argcmin, call a procedure to report an error! */
  341. +     if(argc < -(cmdp->argcmin)) {
  342. +         /* Insufficient arguments */
  343. +         (*(void(*)())cmdp->argc_errmsg)(argc,line);
  344. +         return -1;
  345. +     }
  346.       if(cmdp->func == NULLFP)
  347.           return 0;
  348.       if(cmdp->stksize == 0){
  349. ***************
  350. *** 245,250 ****
  351. --- 254,265 ----
  352.       if(argc < cmdp->argcmin){
  353.           if(cmdp->argc_errmsg != NULLCHAR)
  354.               printf("Usage: %s\n",cmdp->argc_errmsg);
  355. +         return -1;
  356. +     }
  357. +     /* [mea@utu.fi] */
  358. +     if(argc < -(cmdp->argcmin)) {
  359. +         /* Insufficient arguments */
  360. +         (*(void(*)())cmdp->argc_errmsg)(argc,argv);
  361.           return -1;
  362.       }
  363.       if(cmdp->stksize == 0){
  364. *** netuser.c    1992/06/21 08:42:10    1.2
  365. --- netuser.c    1993/01/06 05:02:50
  366. ***************
  367. *** 11,26 ****
  368.   
  369.   /* Convert Internet address in ascii dotted-decimal format (44.0.0.1) to
  370.    * binary IP address
  371.    */
  372.   int32
  373.   aton(s)
  374.   register char *s;
  375.   {
  376. !     int32 n;
  377.   
  378.       register int i;
  379.   
  380.       n = 0;
  381.       if(s == NULLCHAR)
  382.           return 0;
  383.       for(i=24;i>=0;i -= 8){
  384. --- 11,28 ----
  385.   
  386.   /* Convert Internet address in ascii dotted-decimal format (44.0.0.1) to
  387.    * binary IP address
  388. +  * [mea@utu.fi]: Remember that  127.0.0.1 == 127.1 -- in most systems anyway!
  389.    */
  390.   int32
  391.   aton(s)
  392.   register char *s;
  393.   {
  394. !     int32 n, m;
  395.   
  396.       register int i;
  397.   
  398.       n = 0;
  399. +     m = 0; /* [mea@utu.fi] */
  400.       if(s == NULLCHAR)
  401.           return 0;
  402.       for(i=24;i>=0;i -= 8){
  403. ***************
  404. *** 29,40 ****
  405.               s++;
  406.           if(*s == '\0')
  407.               break;
  408. !         n |= (int32)atoi(s) << i;
  409.           if((s = strchr(s,'.')) == NULLCHAR)
  410.               break;
  411.           s++;
  412.       }
  413. !     return n;
  414.   }
  415.   /* Convert an internet address (in host byte order) to a dotted decimal ascii
  416.    * string, e.g., 255.255.255.255\0
  417. --- 31,43 ----
  418.               s++;
  419.           if(*s == '\0')
  420.               break;
  421. !         m = (int32)atoi(s);
  422.           if((s = strchr(s,'.')) == NULLCHAR)
  423.               break;
  424. +         n |= m << i;
  425.           s++;
  426.       }
  427. !     return n | m;
  428.   }
  429.   /* Convert an internet address (in host byte order) to a dotted decimal ascii
  430.    * string, e.g., 255.255.255.255\0
  431.